package com.elder.web.controller.business;

import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.elder.business.domain.ApartmentDict;
import com.elder.business.service.IApartmentDictService;
import com.elder.common.annotation.Anonymous;
import com.elder.common.core.domain.AjaxResult;
import com.elder.common.core.page.TableDataInfo;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ApartmentDictController {

    @Autowired
    private IApartmentDictService apartmentDictService;


    @Anonymous
    @RequestMapping("/apartment.dict.get")
    public String getDictInfo(){
        return apartmentDictService.getAllDictInfo().toJSONString();
    }

    @Anonymous
    @RequestMapping("/apartment.dict.get.bySuperCode")
    private TableDataInfo getDictInfoBySuperCode(Integer superCode){
        return apartmentDictService.getDictInfoBySuperCode(superCode);
    }

    @Anonymous
    @RequestMapping("/apartment.dictList.get")
    public JSONObject getDictGroupList(){
        return apartmentDictService.getDictGroupList();
    }

    @Anonymous
    @RequestMapping("/apartment.dictInfo.update")
    public AjaxResult updateDictInfo(ApartmentDict apartmentDict){
        return apartmentDictService.updateDictInfo(apartmentDict);
    }

}
